<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Channel修正</title>
	<link type="text/css" href="/css/admin/default.css" rel="stylesheet" />
	<link type="text/css" href="/css/admin/index.css" rel="stylesheet" />
</head>
<body>
	<div id="actionbar">
		<a href="/admin/">HOMEへ</a>
	</div>
	<!-- コンテンツ -->
	<div id="content">
		<h3>Channel修正</h3>
		<form method="post" action="channelUpdate">
		<table id="table-01">
			<tr>
				<th>項目名</th>
				<th>入力項目</th>
				<th>アクション</th>
			</tr>
			<tr>
				<th>Channel名</th>
				<td><input type="text" name="channelName" size="50" value="${channelModel.name }" /></td>
				<td rowspan="6"><input type="submit" name="submit" value="修正"/></td>
			</tr>
			<tr>
				<th>表示順</th>
				<td><input type="text" name="index" size="2" value="${channelModel.index }" /></td>
			</tr>
			<tr>
				<th>description</th>
				<td><textarea name="description" cols=45 rows=3 >${channelModel.description }</textarea></td>
			</tr>
			<tr>
				<th>キーワード</th>
				<td>
					<ul>
						<c:forEach var="keyWord" items="${channelModel.keyWordList}" varStatus="kl" >
						<li>${keyWord}</li>
						</c:forEach>
					</ul><br />
					<input type="text" name="keyWord" size="50" value="${keyWord}" />
				</td>
			</tr>
			<tr>
				<th>Channel説明</th>
				<td><textarea name="content" cols=45 rows=30 >${channelModel.contentString }</textarea></td>
			</tr>
			<tr>
				<th>Channel画像</th>
				<td><input type="text" name="channelImageCode" size="50" value="${channelModel.channelImageCode }" /></td>
			</tr>
		</table>
		<input type="hidden" name="channel" value="${channel}" />
		</form>
	</div>
	<br />
	<br />
	<form action="${f:url('file/uploadForChannel')}" method="post" enctype="multipart/form-data">
		<input type="file" name="formFile" /><br />
		<input type="submit" value="Upload"/>
		<input type="hidden" name="channel" value="${channel}" />
		<input type="hidden" name="chapter" value="${chapter}" />
		<input type="hidden" name="page" value="${page}" />
	</form>
	<br />
	<br />
	<table>
		<c:if test="${fn:length(dataList) > 0}">
		<thead>
			<tr><th>Image</th><th>Key</th><th>サイズ</th><th>ダウンロード</th><th>全画面表示</th><th>削除</th></tr>
		</thead>
		</c:if>
		<tbody>
		<c:forEach var="e" items="${dataList}">
			<tr>
				<td><a href="/files?key=${e.keyString}" rel="lightbox" title="テスト"><img src="/files?key=${e.keyString}" /></a></td>
				<td style="padding:5 20 5 5;">${e.keyString}</td>
				<td style="padding:5 20 5 5;">${e.length}</td>
				<c:set var="downloadUrl" value="/admin/file/download?key=${e.keyString}"/>
				<c:set var="showUrl" value="/admin/file/show?key=${e.keyString}"/>
				<c:set var="deleteUrl" value="/admin/file/delete?key=${e.keyString}"/>
				<td style="padding:5 20 5 5;"><a href="${f:url(downloadUrl)}">Download</a></td>
				<td style="padding:5 20 5 5;"><a href="${f:url(showUrl)}">Show</a></td>
				<td style="padding:5 20 5 5;"><a href="${f:url(deleteUrl)}" onclick="return confirm('delete OK?')">Delete</a></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<br />
	<br />

</body>
</html>